using System;
using System.Collections.Generic;
using System.Collections;

namespace HSIFileViewer
{
	public class HSIBaseFormat
	{
		IDictionary _theaters;
		IDictionary _titles;
		IDictionary _releases;
		IDictionary _circuits;
		
		public HSIBaseFormat ()
		{
			_theaters = new Dictionary<string, DataEntry>();
			_titles = new Dictionary<string, DataEntry>();
			_releases = new Dictionary<string, DataEntry>();
			_circuits = new Dictionary<string, DataEntry>();
		}
		
		public void AddTheater(string id, string name)
		{
			DataEntry entry = new DataEntry();
			entry.Id = id;
			entry.Name = name;
			_theaters.Add(id, entry);
		}
		
		public DataEntry RemoveTheater(string id)
		{
			DataEntry entry = (DataEntry)_theaters[id];
			if (entry != null) {
				_theaters.Remove(id);
			}
			return entry;
		}
		
		public void AddTitle(string id, string name)
		{
			DataEntry entry = new DataEntry();
			entry.Id = id;
			entry.Name = name;
			_titles.Add(id, entry);
		}
		
		public DataEntry RemoveTitle(string id)
		{
			DataEntry entry = (DataEntry)_titles[id];
			if (entry != null) {
				_titles.Remove(id);
			}
			return entry;
		}
		
		public void AddRelease(string id, string name)
		{
			DataEntry entry = new DataEntry();
			entry.Id = id;
			entry.Name = name;
			_releases.Add(id, entry);
		}
		
		public DataEntry RemoveRelease(string id)
		{
			DataEntry entry = (DataEntry)_releases[id];
			if (entry != null) {
				_releases.Remove(id);
			}
			return entry;
		}
		
		public void AddCircuit(string id, string name)
		{
			DataEntry entry = new DataEntry();
			entry.Id = id;
			entry.Name = name;
			_circuits.Add(id, entry);
		}
		
		public DataEntry RemoveCircuit(string id)
		{
			DataEntry entry = (DataEntry)_circuits[id];
			if (entry != null) {
				_circuits.Remove(id);
			}
			return entry;
		}
	}
	
	public class DataEntry
	{
		string _id;
		string _name;
		
		public String Id
		{
			get { return _id; }
			set { _id = value; }
		}
		
		public String Name
		{
			get { return _name; }
			set { _name = value; }
		}
	}
	
	public class GrossesEntry
	{
		DateTime _exhibition_date;
		float _revenue;
		int _xtns;
		char _justification_code;
		string _theater_id;
		string _title_id;
		string _release_id;
		string _circuit_id;
	}
}
